package com.hahehiho.myalbum;

public class BackupUtil {
	private static BackupInfoStatus worker;
	
	public static BackupInfoStatus getWorker() {
		return worker;
	}
	
	synchronized public static void startWorker(String path, String all) {
		boolean isPermission = true;
		boolean isAll = Boolean.parseBoolean(all);
		
		if(worker != null)
			isPermission = worker.isClose();
			
		if(!isPermission) {
			System.out.println("no start worker");
			return;
		}

		worker = null;
		worker = new BackupInfoStatus();

		worker.runRecreate(path, isAll);
	}
}
